Xbasic

SQL::ResultSetGoToRow Method

Syntax

Result as L = GoToRow(RowIndex as N)

Arguments

RowIndexNumeric

The row in the SQL::ResultSet to return. The index for the first row is 1.

Returns

ResultLogical

Returns true (.T.) if the operation was successful; otherwise false (.F.).

Description

Position to the row requested (backward movement is not supported by all databases).

Discussion

The GoToRow() method positions to the specified row in a SQL::ResultSet. Some databases do not support backward positioning.

Example

dim conn as SQL::Connection
dim rs as SQL::ResultSet
dim connString as C
dim select_exp as C
connString = "::Name::AADemo-Northwind"
select_exp = "select CustomerID from customers where country = 'France'"
if .not. conn.open(connString)
    ui_msg_box("Error", conn.CallResult.text)
    end
end if
if .not. conn.execute(select_exp)
    ui_msg_box("Error", conn.CallResult.text)
    conn.close()
    end
end if
rs = conn.ResultSet
if .not. rs.GoToRow(2) then
    ui_msg_box("Error", rs.callresult.text)
end if
conn.close()